package com.example.rabbitmqtest01.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.annotation.Configuration;
@Slf4j
@Configuration
public class ToQueueReturnCalback implements RabbitTemplate.ReturnCallback {
    @Override
    public void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey) {
        log.error("投递到队列失败message:{},replyCode:{},replyText:{},exchange:{},routingKey:{}",
                message.getBody(),
                replyCode,
                replyText,
                exchange,
                routingKey);

    }
}
